<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <title>CSS3盒子模型</title>
        <style>
            div:nth-child(1) {
                /* 传统盒子模型= width + border + padding */
                width: 200px;
                height: 200px;
                background-color: pink;
                padding: 10px;
                border: 10px solid red;
                /* 不设置 content-box，默认也是传统盒子模型， */
                box-sizing: content-box; 
            }

            div:nth-child(2) {
                /* border-box 让盒子变成CSS3盒子模型 padding 和 border 不会再撑大盒子了 */
                box-sizing: border-box;
                width: 200px;
                height: 200px;
                background-color: purple;
                padding: 10px;
                border: 10px solid blue;
                /* margin: 10px; */
            }
        </style>
    </head>

    <body>
        <div></div>
        <div></div>
    </body>
</html>
